package studentinformationmanagementsystem.servlet.admin;

import studentinformationmanagementsystem.service.StudentService;
import studentinformationmanagementsystem.service.impl.CourseServicelmpl;
import studentinformationmanagementsystem.service.impl.DepartmentServicelmpl;
import studentinformationmanagementsystem.service.impl.StudenServiceImpl;
import studentinformationmanagementsystem.service.impl.TeacherServiceImpl;
import studentinformationmanagementsystem.servlet.BaseServlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author 苗庆
 * @version 1.0
 */


@WebServlet("/admin/function/index.do")
public class AdminServletLong extends BaseServlet {

    StudentService studenService = new StudenServiceImpl();


    //查看学生数量
    public void qullStudentQuantity(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Integer integer = studenService.queryForPageTotalCount();
        response.getWriter().print(integer);
    }

    //查看教师数量
    public void queryTeacherCount(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        TeacherServiceImpl teacherService = new TeacherServiceImpl();
        Integer integer = teacherService.queryTeacherCount();
        response.getWriter().print(integer);
    }

    //查看课程数量
    public void queryCoureCount(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        CourseServicelmpl courseServicelmpl = new CourseServicelmpl();
        Integer integer = courseServicelmpl.queryCoureCount();
        response.getWriter().print(integer);
    }

    //查看学院数量
    public void queryDepartmentCount(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        DepartmentServicelmpl departmentServicelmpl = new DepartmentServicelmpl();
        Integer integer = departmentServicelmpl.queryDepartmentCount();
        response.getWriter().print(integer);
    }


}
